<template>
<div>

    <div >
        <font size="6" bold   style="position:relative;left:700px">劳务实名制查看</font>
      </div>
      <br>
      
<el-form :model="laber"  label-width="100px" class="demo-ruleForm">
    <!-- 第一个表格 -->
    <table class="divtable" width="100%">
        <tr>
            <td colspan="8" class="color">基本信息</td>
        </tr>
        <tr>
           
            <td class="tabletd">姓名:</td>
            <td><el-input v-model="laber.name"   readonly></el-input></td>
            <td class="tabletd">身份证:</td>
            <td ><el-input v-model="laber.sfz"   readonly></el-input></td>
             <td class="tabletd">工种:</td>
            <td><el-input v-model="laber.profession_name"   readonly></el-input></td>
             <td class="tabletd">日期:</td>
            <td><el-input v-model="laber.apply_date"  readonly></el-input></td>
        </tr>
        <tr>
            <td class="tabletd">项目名称:</td>
            <td><el-input v-model="laber.p_id" readonly></el-input></td>
            <td class="tabletd"></td>
            <td></td>
            <td class="tabletd"></td>
            <td></td>
            <td class="tabletd"></td>
            <td></td>
        </tr>
        <tr>
            <td class="tabletd">工作内容:</td>
            <td colspan="7"><el-input v-model="laber.commit" type="textarea" rows="4"  readonly></el-input></td>
        </tr>
        
    </table>
    </el-form>

    <br>
    <div><font>照片</font></div>
    <el-table :data="attachemen_info" border style="width: 100%;">
    <el-table-column prop="file_name" label="文件名称">
    </el-table-column>
    <el-table-column prop="infoname"  label="上传人">
    </el-table-column>
    <el-table-column prop="upload_date" label="上传时间">
    </el-table-column>
     <el-table-column fixed="right" width="200">
      <template slot-scope="scope">
        <el-button @click="handleClick(scope.row)" type="text" size="small">下载</el-button>
      </template>
    </el-table-column>
  </el-table>

  <br>
    <div><font>附件</font></div>
    <el-table :data="attachemen_info2" border style="width: 100%;">
    <el-table-column prop="file_name" label="文件名称">
    </el-table-column>
    <el-table-column prop="infoname"  label="上传人">
    </el-table-column>
    <el-table-column prop="upload_date" label="上传时间">
    </el-table-column>
     <el-table-column fixed="right" width="200">
      <template slot-scope="scope">
        <el-button @click="handleClick(scope.row)" type="text" size="small">下载</el-button>
      </template>
    </el-table-column>
  </el-table>



  
    





  </div>
</template>

<script>

    import providerinfo from '@/model/smj/Providerinfo'
    const provider= new providerinfo;

import LaoWuShiMingZhi from '@/model/smj/LaoWuShiMingZhi'
const laowushimingzhi = new LaoWuShiMingZhi;


export default {
  name: "LaoWuHeTong",
  components: {},
  directives: {},
  data() {
    return {
        laber:{},
        params:{},
        attachemen_info:[],
        attachemen_info2:[],
    }
  },
  mounted() {},
  methods: {

            list(){
                let id = this.$route.query.id
                this.params.id=id;
                laowushimingzhi.listrealname(this.params).then((response)=>{
                    this.laber=response.data.data.data.records[0];
                    //查询照片
                    let ids = response.data.data.data.records[0].attach_ids
                    provider.list4(ids).then((response)=>{
                        this.attachemen_info= response.data;
                    })
                    //文件附录
                    let ids2 = response.data.data.data.records[0].attach_ids2
                    provider.list4(ids2).then((response)=>{
                        this.attachemen_info2= response.data;
                    })

                })

            },

            //文件下载
            handleClick(row){
                console.log(row)
                location.href = 'http://localhost/download?token=' + this.token + '&url=' + row.file_path + '&name=' + row.file_name
            },


  },
  computed: {
            token: {
                get() {
                    return this.$store.state.token
                }
            },
            checkRoute(){
                return Object.keys(this.$route.params).length != 0
            }
        },
  created() {
       this.list();
  },
  
};
</script>

<style>
.divtable{
    border-collapse:collapse;
}
.divtable td{
    padding:10px;
    border:1px solid rgb(7, 136, 175);
}
.tabletd{
    text-align: right;
    background-color: rgb(113, 222, 241);
}
.color{
    background-color: rgb(113, 222, 241);
}
.divtable2{
    border-collapse:collapse;
}
.divtable2 td{
    padding:10px;
    border:1px solid rgb(7, 136, 175);
}
.td{
    text-align: center;
}
</style>